package com.changgou.service.impl;

import entity.IdWorker;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public  void makeOrder(String OrderUser ,String proDu, int mun){
        IdWorker orderid = new IdWorker(0,0);
        System.out.println(orderid.nextId());

        String exChangeName = "fanout_order_exchage";
        String routingkey = "";
        rabbitTemplate.convertAndSend(exChangeName,routingkey,"idwork生成--》"+orderid.nextId()+"");

    }
}
